<template>
  <header class="header">
    <div class="header-content">
      <div class="logo">
        <router-link to="/" @click="goToHome">
          <img src="../assets/images/logo.png" alt="公司logo" style="font-size: 20px;">
        </router-link>
      </div>
      <div class="text-box">
        <div class="text-line">才知</div>
        <div class="text-line indent-2">改变</div>
        <div class="text-line indent-3">未来</div>
      </div>
    </div>
  </header>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const goToHome = () => {
  router.push('/')
}
</script>

<style scoped>
body {
  padding: 0;
  margin: 0;
}
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  height: 95px;
}

.header-content {
  max-width: 1200px;
  margin: 5px auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.logo {
  cursor: pointer;
  transition: opacity 0.3s;
  height: 100px;
}

.logo:hover {
  opacity: 0.8;
}

.logo img {
  height: 90px;
  width: auto;
  border-right: 1px solid gray;
}

.text-box {
  display: flex;
  flex-direction: column;
  justify-content: space-around; /* 垂直均匀分布 */
  height: 90px;
  padding-left: 5px;
  font-size: 18px; /* 文字大小 */
  color: #333; /* 文字颜色 */
}

.text-line {
  text-align: left; 
  margin-top: 0;
}

.indent-2 {
  text-indent: 2em; /* 第二行缩进两个字 */
}

.indent-3 {
  text-indent: 3em; /* 第三行缩进三个字 */
}
</style>